<template>
  <div class="page-container">
    <div class="body-container">
      <div class="head-container">
        <img v-lazy="bgImg" class="bgimg-head" />
        <img :src="photoImg" class="minphoto-head" />
      </div>
      <div class="content-container">
        <div class="nav-container">
          <img :src="mineNav" />
        </div>
        <div class="info-container">
          <div class="title">基本信息</div>
          <ul>
            <li>
              <span class="inline"></span>
              <span class="field">NickName:</span>
              <span class="info">{{ mineInfo.nickname }}</span>
            </li>
            <li>
              <span class="inline"></span>
              <span class="field">QQ:</span>
              <span class="info">{{ mineInfo.qq }}</span>
            </li>
            <li>
              <span class="inline"></span>
              <span class="field">Email:</span>
              <span class="info">{{ mineInfo.email }}</span>
            </li>
            <li>
              <span class="inline"></span>
              <span class="field">Wx:</span>
              <span class="info">{{ mineInfo.wx }}</span>
            </li>
            <li>
              <span class="inline"></span>
              <span class="field">Phone:</span>
              <span class="info">{{ mineInfo.phone }}</span>
            </li>
          </ul>
        </div>
        <div class="skill-container">
          <div class="title">个人技能</div>
          <div class="inline"></div>
          <ul>
            <li
              v-for="(item, index) of minesKill"
              :key="index"
              @mouseenter="hoverShowSahde"
              @mouseleave="hoverHideSahde"
            >
              <div class="image">
                <img :src="item.photo" />
              </div>
              <div class="text">{{ item.title }}</div>
            </li>
          </ul>
        </div>
        <div class="project-container">
          <div class="title">项目展示</div>
          <div class="swiper-container">
            <!-- <swiper :options="swiperOption" ref="mySwiper">
              <swiper-slide>I'm Slide 1</swiper-slide>
              <swiper-slide>I'm Slide 2</swiper-slide>
              <swiper-slide>I'm Slide 3</swiper-slide>
              <div class="swiper-pagination" slot="pagination"></div>
              <div class="swiper-button-prev" slot="button-prev"></div>
              <div class="swiper-button-next" slot="button-next"></div>
            </swiper> -->
          </div>
        </div>
        <go-top :has-outline="false" :right="40"></go-top>
      </div>
    </div>
  </div>
</template>

<script>
import { swiper, swiperSlide } from "vue-awesome-swiper";
import "swiper/dist/css/swiper.css";
import GoTop from "@inotom/vue-go-top";
import ApiService from "@/service/index";
import { formtTime } from "@/utils/tools";
import {
  MINE_SKILL,
  MINE_BANNER,
  MINE_PHOTO,
  NAV_PHOTO,
  MINE_INFO
} from "@/config/config";
export default {
  name: "MineFile",
  components: {
    swiper,
    swiperSlide
  },

  computed: {
    swiper() {
      return this.$refs.mySwiper.swiper;
    }
  },
  mounted() {
    // current swiper instance
    // 然后你就可以使用当前上下文内的swiper对象去做你想做的事了
    console.log("this is current swiper instance object", this.swiper);
    // this.swiper.slideTo(3, 1000, false);
  },
  data() {
    return {
      bgImg: MINE_BANNER,
      photoImg: MINE_PHOTO,
      mineNav: NAV_PHOTO.mine,
      minesKill: MINE_SKILL,
      mineInfo: MINE_INFO,
      swiperOption: {
        loop: true,
        autoplay: {
          delay: 3000,
          stopOnLastSlide: false,
          disableOnInteraction: false
        },
        // 显示分页
        pagination: {
          el: ".swiper-pagination",
          clickable: true //允许分页点击跳转
        },
        // 设置点击箭头
        navigation: {
          nextEl: ".swiper-button-next",
          prevEl: ".swiper-button-prev"
        }
      }
    };
  },
  methods: {
    hoverShowSahde(e) {
      let element = e.target || e.srcElement;
      element.className += ` animate__animated animate__pulse`;
    },
    hoverHideSahde(e) {
      let element = e.target || e.srcElement;
      element.className = ` `;
    }
  }
};
</script>

<style lang="scss" scoped>
$theme: #f2db4d;
.body-container {
  width: 100%;
  height: 100%;
}
.head-container {
  width: 100%;
  height: 376px;
  .bgimg-head {
    width: 100%;
    height: 313px;
    .img {
      width: 100%;
      height: 100%;
    }
  }
  .minphoto-head {
    width: 123px;
    height: 123px;
    margin: 0 auto;
    margin-top: -63px;
    display: block;
  }
}
.content-container {
  width: 1305px;
  height: 100%;
  margin: 0 auto;
  .nav-container {
    width: 102px;
    height: 99px;
    margin-top: 10px;
    img {
      width: 100%;
      height: 100%;
    }
  }
  .info-container {
    width: 100%;
    height: 400px;
    margin-top: 50px;
    .title {
      width: 132px;
      font-size: 28px;
      padding-left: 20px;
      padding-bottom: 10px;
      border-bottom: 2px dashed #000;
    }
    ul {
      list-style: none;
      margin-top: 32px;
      padding: 0;
      li {
        height: 50px;
        margin-top: 18px;
        line-height: 50px;
        .inline {
          width: 8px;
          height: 50px;
          background-color: $theme;
          display: inline-block;
          float: left;
        }
        .field {
          margin-left: 42px;
          font-size: 18px;
          width: 50px;
          height: 50px;
          display: inline-block;
          // height: 50px;
          // line-height: 50px;
        }
        .info {
          margin-left: 88px;
        }
      }
    }
  }
  .skill-container {
    width: 100%;
    height: 400px;
    margin-top: 100px;
    .title {
      width: 132px;
      font-size: 28px;
      padding-left: 20px;
      padding-bottom: 10px;
      border-bottom: 2px dashed #000;
    }
    .inline {
      height: 290px;
      float: left;
      width: 8px;
      background-color: $theme;
      margin-top: 65px;
    }
    ul {
      list-style: none;
      padding: 0;
      margin-left: 10px;
      //margin-top: 0px;
      li {
        float: left;
        height: 140px;
        text-align: center;
        padding-left: 68px;
        font-size: 18px;
        padding-top: 50px;
        img {
          width: 147px;
          height: 72px;
        }
      }
    }
  }
  .project-container {
    width: 100%;
    height: 400px;
    margin-top: 130px;
    .title {
      width: 132px;
      font-size: 28px;
      padding-left: 20px;
      padding-bottom: 10px;
      border-bottom: 2px dashed #000;
    }
  }
}

.swiper-container .swiper-container {
  width: 100%;
  height: 200px;
  background: pink;
}
.swiper-container .swiper-container .swiper-slide {
  width: 100%;
  line-height: 200px;
  background: yellowgreen;
  color: #000;
  font-size: 16px;
  text-align: center;
}
</style>